/*
 *  synchro_vector.h
 */

#ifndef SYNCHRO_VECTOR_H
#define SYNCHRO_VECTOR_H

#include <vector>
#include "mutex.h"

template<class T>
class SynchroVector {
public:
    SynchroVector();
    ~SynchroVector();
    Mutex* getMutex();
    std::vector<T>* getVector();
private:
    Mutex mutex;
    std::vector<T> v;
};

template<class T>
SynchroVector<T>::SynchroVector() : mutex(), v() {}

template<class T>
SynchroVector<T>::~SynchroVector() {}

template<class T>
Mutex* SynchroVector<T>::getMutex() {
    return &mutex;
}

template<class T>
std::vector<T>* SynchroVector<T>::getVector() {
    return &v;
}

#endif  //SYNCHRO_VECTOR_H

//{+}

